Skip to content

a11y(4.1.3): Toaster role="log" → per-toast role="status"/"alert" for correct AT announcement semantics#3560

Open
rosanusi wants to merge 1 commit into
mainfrom
wcag/4.1.3-toaster-role-status-alert
Open

a11y(4.1.3): Toaster role="log" → per-toast role="status"/"alert" for correct AT announcement semantics#3560
rosanusi wants to merge 1 commit into
mainfrom
wcag/4.1.3-toaster-role-status-alert

Conversation

@rosanusi

Copy link
Copy Markdown
Contributor

Summary

  • Removes role="log" from the Toaster container — role="log" is intended for navigable chronological logs, not transient notifications, and produces inconsistent announcement timing across screen readers
  • Adds getRole() to Toast: error variant → role="alert" (assertive, interrupts AT speech); all other variants → role="status" (polite, doesn't interrupt)
  • Adds aria-atomic="true" on each toast so the full content re-announces on every DOM insertion, even when consecutive toasts share similar markup

This mirrors the convention already in holocene/alert.svelte and closes WCAG 2.2 SC 4.1.3 (Status Messages) for the primary notification surface in both repos (cascades to cloud-ui-main via the @temporalio/ui tarball re-pack).

Changes

File Change
src/lib/holocene/toaster.svelte Remove role="log" from container div
src/lib/holocene/toast.svelte Add getRole(), $: role, {role}, aria-atomic="true" on toast div

Test plan

  • Inspect DOM: each toast <div> has role="status" (success / info / warning / primary) or role="alert" (error); container <div> has no role
  • Screen-reader smoke test (VoiceOver / NVDA): success/info/warning toast announces politely; error toast announces assertively (interrupts)
  • Two consecutive toasts of the same variant: both are announced individually (no batching)
  • Regression: workflow client-action confirmations (Terminate / Cancel / Reset / Signal / Update) fire success toast — renders and announces correctly
  • All position variants (top-left through bottom-right) still position correctly visually
  • axe-core: no new violations on a page with a live toast

A11y-Audit-Ref: 4.1.3-toaster-role-status-alert

🤖 Generated with Claude Code

…ert"

- Remove role="log" from the Toaster container; live-region semantics
  move entirely to individual Toast instances
- Add getRole() to Toast: error variant → role="alert" (assertive);
  all others → role="status" (polite)
- Add aria-atomic="true" so the full toast content re-announces on
  each insertion, even when consecutive toasts share similar markup

Screen readers can now distinguish urgency between error and
informational toasts (WCAG 2.2 SC 4.1.3 Status Messages).

A11y-Audit-Ref: 4.1.3-toaster-role-status-alert

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Jun 12, 2026 3:45pm

Request Review

@github-actions github-actions Bot added a11y Accessibility audit PR a11y:bucket-3 Bucket 3: engineer required a11y:sc-4.1.3 labels Jun 12, 2026

<div class={toast({ position: $position })} role="log">
<div class={toast({ position: $position })}>
{#each $toasts as { message, variant, id, link } (id)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Type 'ToastVariant | undefined' is not assignable to type 'ToastVariant'.
  • ⚠️ Type 'string | undefined' is not assignable to type 'string'.

@temporal-cicd

temporal-cicd Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

📊 Strict Mode: 2 errors in 1 file (0.2% of 904 total)

src/lib/holocene/toaster.svelte (2)
  • L44:40: Type 'ToastVariant | undefined' is not assignable to type 'ToastVariant'.
  • L44:50: Type 'string | undefined' is not assignable to type 'string'.

Generated by 🚫 dangerJS against dffc8dc

@rosanusi rosanusi marked this pull request as ready for review June 12, 2026 16:30
@rosanusi rosanusi requested a review from a team as a code owner June 12, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y:bucket-3 Bucket 3: engineer required a11y:sc-4.1.3 a11y Accessibility audit PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant